using Comdiv.Extensions;
using Comdiv.Model;
using Comdiv.Model.Interfaces;
using Comdiv.Logging;
using Comdiv.Application;
using Comdiv.Model.Mapping;
using Comdiv.Persistence;
using Comdiv.Inversion;
using Comdiv.Security.Acl;
using Comdiv.Conversations;
using Comdiv.IO;
using Comdiv.Security;
using System.Linq;

namespace Comdiv.Dbfs{
    public class FileHistoryMap : DbfsBaseMap<FileHistory>
    {
        public FileHistoryMap()
            : base()
        {
            ReadOnly();
            WithTable("usr_history_view");
            Map(x => x.Revision);
            Map(x => x.System);
            Map(x => x.Mime);
            Map(x => x.Extension);
            Map(x => x.Hash).ReadOnly();
            Map(x => x.Size).ReadOnly();
            References(x => x.Data).Standard<IFileContent, FileContent>("Data", false);
            References(x => x.Target).Standard<IFile, File>("RefTo", false);
            References(x => x.Source).Standard<IFile, File>("SrcId", false);
            Map(x => x.Usr);
            Map(x => x.Owner).ReadOnly();
            Map(x => x.Editor).ReadOnly();
            Map(x => x.CreateTime).ReadOnly();
            Map(x => x.ChangeTime).ReadOnly();
            Map(x => x.ReadList);
            Map(x => x.ChangeList);
            //Map(x => x.Tag);
            Map(x => x.Deleted);
            Map(x => x.Archived);
            Map(x => x.ReadOnly);
        }
    }
}